// hook name开头要大写
import React from 'react'
export default function Sthkzj(props) {
  console.log(props)
  let [count, setCount] = React.useState(0) //此方法可以在函数式组件内使用state
  let add = () => {
    // setCount(count+1) 第一种写法
    setCount(count => count + 1)
  }
  return (
    <div>
      <div>当前值为：{count}</div>
      <button onClick={add}>点击+1</button>
    </div>
  )
}
